package com.spcloud.fegin.client;

import com.spcloud.fegin.client.service.OrderService;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author GuoChunbo
 * @create 2020-03-12 8:52
 * @Description: 类的描述
 */
@SpringCloudApplication
@EnableFeignClients(clients = {OrderService.class}) //启用加载
public class FeginClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(FeginClientApplication.class, args);
    }

    //注入
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return  new RestTemplate();
    }
}
